home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 24
/
Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso
/
Aminet
/
dev
/
c
/
AmiVoGL_MDEV.lha
/
examples
/
sinewave.c
< prev
next >
Wrap
C/C++ Source or Header
|
1997-08-18
|
920b
|
78 lines
#ifdef SGI
#include "gl.h"
#include "device.h"
#include "hershey.h"
#else
#include "vogl.h"
#include "vodevice.h"
#endif
#ifndef TC
#include <math.h>
#else
extern double sin(), cos();
#endif
#ifndef PI
#define PI 3.14159261358979
#endif
#define STEP PI / 180.0
int main(void)
{
float a;
int i;
float v[2];
short val;
winopen("bgnline/endline test");
unqdevice(INPUTCHANGE);
qdevice(KEYBD);
color(BLACK);
clear();
ortho2(-0.5, 2 * PI + .5, -1.5, 1.5);
color(GREEN);
bgnline();
v[0] = -0.5;
v[1] = 0.0;
v2f(v);
v[0] = 2 * PI + .5;
v[1] = 0.0;
v2f(v);
endline();
color(RED);
bgnline();
v[0] = 0.0;
v[1] = -1.3;
v2f(v);
v[0] = 0.0;
v[1] = 1.3;
v2f(v);
endline();
color(YELLOW);
bgnline();
v[0] = v[1] = 0.0;
v2f(v);
for (a = 0.0; a <= 2 * PI; a += STEP) {
v[0] = a;
v[1] = cos(a);
v2f(v);
}
endline();
circ(60,100,40);
qread(&val);
gexit();
}